package com.atguigu.utils;

import org.apache.commons.beanutils.BeanUtils;

import java.util.Map;

/**
 * @author 14587
 * @date 2020/10/21 23:00
 */
public class webUtils {
    public static <T> T copyParamToBean(Map value, T bean){

        try {
            BeanUtils.populate(bean,value);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }

    public static int parseInt(String strInt,int defaultValue) {

        if (strInt == null)
            return defaultValue;
            else{
                return Integer.parseInt(strInt);
            }
        }
}
